import random
random_number =random.randint(1,100)
number = int(input("猜数字 between 1 and 100: "))
gold = 5000
while gold > 0:
    if number > random_number:
        print("大了")
        gold -= 500
    elif number < random_number :
        print("小了")
        gold -= 500
    else :
        print("恭喜猜中，本轮幸运数字：{},你剩余的gold:{}".format(random_number, gold + 3000))
        break
    number = int(input("猜数字 between 1 and 100: "))
else :
    print("金币余额不足,游戏退出")
